﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<BizCollegeWebApp.Models.Survey>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    List of surveys
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        List of surveys</h2>

 <form action="" method="post">
    <input class="searchbox" id="SearchSurvey" name="SearchSurvey" type="text" value="<%: ViewBag.SearchSurvey.ToString() %>"/> 
    <input type="submit" value="Search Survey" />
    <%: Html.ActionLink("Clear", "Index") %>
</form>

    <% if (TempData["Message"] != null)
       { %>
    <b>
        <%: TempData["Message"].ToString() %>
    </b>
    <%} %>
    <p>
        <%: Html.ActionLink("Create New Survey", "Create") %>
    </p>
    <table>
        <tr>
            <th style="width: 85%">
                Title
            </th>
            <th>
                IsActive
            </th>
            <th>
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%: Html.DisplayFor(modelItem => item.Title) %>
            </td>
            <td>
                <%: item.IsActive %>
            </td>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id=item.ID }) %>
                |
                <%: Html.ActionLink("Details", "Details", new { id=item.ID }) %>
                |
                <%: Html.ActionLink("Delete", "Delete", new { id=item.ID }) %>
                 |
                <%: Html.ActionLink("Activate", "Activate", new { id=item.ID }) %>
            </td>
        </tr>
        <% } %>
    </table>
</asp:Content>
